Removed code duplication in position controller

[#71835198]