Achievement refactoring and general cleanup