moved figure positioning helper to util