Improve getApplePosition method