Refactor open project functions