refactored + removed unused debugging messages
removed redundant switch + added private constants
get brackets