Indoor Positioning System (IPS) is a technology used to locate and track objects or people inside buildings, by using sensors, wireless networks, or other means to determine their position. IPS has many applications in various fields such as healthcare, retail, logistics, and security. Achieving IPS of high location accuracy is yet to be explored further. In this experimental research, an IPS based on Bluetooth Low Energy (BLE) 5.1 protocol is implemented and two optimization techniques, parameters calibration and application of Machine Learning Algorithm (MLA) are proposed to improve location accuracy. In Stage 1 of this experiment, the measured Root Mean Square Error (RMSE) value before optimization yielded location accuracy of 0.670m. In Stage 2, four different parameters which include elevation angle, tag height, data rate and walking pace are calibrated and tested. Besides, in Stage 2, three different algorithms which include Support Vector Regression (SVR), Decision Tree (DT) and K-Nearest Neighbor (KNN) are evaluated. As a result, parameters calibration decreased RMSE value down to 0.219m. Additionally, among all three MLAs, KNN illustrated the lowest RMSE value of 0.631m. In Stage 3, the lowest RMSE value of 0.015m is obtained by combining parameters calibration and MLA approaches which improved location accuracy up to 98.5%. The developed framework is operational at our industry partner, ams OSRAM's LED wafer fabrication cleanroom facility.