Refactored most of code

Completed abbreviations, renamed parameters, general readability increase.