Performed misc. refactoring