fixed method permissions + unit tests + minor code cleanup