Constants added + some more code refactorings