Removed redundant parameters and organised methods.