Naming fixes and code beautification